const {create,find} = require('../models/user')

async function userLogin({ username }){

  return await find({ query: { username }})
}//*找用户名

async function userchat ({username}){
  return await find({})
}

async function timeContent (times){
  return await find({query:{time:times}})
}


async function saveUser(data){

  await create(data)//从model里面的users里create创建 存进数据库
}


module.exports = {
  userLogin,
  userchat,
  saveUser,
  timeContent
}